package com.clinic.domain;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
@PrimaryKeyJoinColumn(name = "pt_obj_id")
public class Patient extends Super_type {

	private static final long serialVersionUID = 1L;

	@Column(insertable = false, updatable = false)
	private int pt_obj_id;
	@Column(length = 128)
	private String first_name;
	@Column(length = 128)
	private String last_name;
	@Column(length = 32)
	private String passwrd;
	@Column(length = 256)
	private String full_name;
	@Column(length = 256)
	private String address;
	@Column(length = 16)
	private String country_code;
	@Column(length = 128)
	private String city_name_en;
	private int postalcode;
	@Column(length = 128)
	private String email_address;
	@Column(nullable = true)
	private boolean is_baby;
	@Column(length = 32)
	private String mobile_phone;
	@Column(length = 32)
	private String mobile_phone2;
	@Column(length = 32)
	private String home_phone;
	private Date birthday;
	@Column(nullable = true)
	private boolean gender;
	@Column(length = 64)
	private String mrn;
	@Column(length = 32)
	private String profile_status;
	@Column(nullable = true)
	private boolean is_clinic_admin;
	@Column(length = 1024)
	private String description;
	@Column(length = 32)
	private String profile_view;
	@Column(length = 64)
	private String token;
	@Column(nullable = true)
	private boolean valid_email;
	@OneToOne(mappedBy = "patient", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Profile profile;

	public Patient() {
		super();
	}

	public Patient(String obj_owner_name, String first_name, String last_name,
			String passwrd, String full_name, String address,
			String country_code, String city_name_en, String email_address,
			boolean is_baby, String mobile_phone, String mobile_phone2,
			String home_phone, Date birthday, boolean gender, String mrn,
			String profile_status, boolean is_clinic_admin, String description,
			String profile_view, int postalcode) {
		super(obj_owner_name);
		this.first_name = first_name;
		this.last_name = last_name;
		this.passwrd = passwrd;
		this.full_name = full_name;
		this.address = address;
		this.country_code = country_code;
		this.city_name_en = city_name_en;
		this.email_address = email_address;
		this.is_baby = is_baby;
		this.mobile_phone = mobile_phone;
		this.mobile_phone2 = mobile_phone2;
		this.home_phone = home_phone;
		this.birthday = birthday;
		this.gender = gender;
		this.mrn = mrn;
		this.profile_status = profile_status;
		this.is_clinic_admin = is_clinic_admin;
		this.description = description;
		this.profile_view = profile_view;
		this.postalcode = postalcode;
	}

	public Patient(String first_name, String last_name, String passwrd,
			String email_address, String token) {
		super();
		this.first_name = first_name;
		this.last_name = last_name;
		this.passwrd = passwrd;
		this.email_address = email_address;
		this.token = token;
	}

	public int getPt_obj_id() {
		return pt_obj_id;
	}

	public String getFirst_name() {
		return first_name;
	}

	public void setFirst_name(String first_name) {
		this.first_name = first_name;
	}

	public String getLast_name() {
		return last_name;
	}

	public void setLast_name(String last_name) {
		this.last_name = last_name;
	}

	public String getPasswrd() {
		return passwrd;
	}

	public void setPasswrd(String passwrd) {
		this.passwrd = passwrd;
	}

	public String getFull_name() {
		return full_name;
	}

	public void setFull_name(String full_name) {
		this.full_name = full_name;
	}

	public String getEmail_address() {
		return email_address;
	}

	public void setEmail_address(String email_address) {
		this.email_address = email_address;
	}

	public boolean isIs_baby() {
		return is_baby;
	}

	public void setIs_baby(boolean is_baby) {
		this.is_baby = is_baby;
	}

	public String getMobile_phone() {
		return mobile_phone;
	}

	public void setMobile_phone(String mobile_phone) {
		this.mobile_phone = mobile_phone;
	}

	public String getMobile_phone2() {
		return mobile_phone2;
	}

	public void setMobile_phone2(String mobile_phone2) {
		this.mobile_phone2 = mobile_phone2;
	}

	public String getHome_phone() {
		return home_phone;
	}

	public void setHome_phone(String home_phone) {
		this.home_phone = home_phone;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public boolean isGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	public String getMrn() {
		return mrn;
	}

	public void setMrn(String mrn) {
		this.mrn = mrn;
	}

	public String getProfile_status() {
		return profile_status;
	}

	public void setProfile_status(String profile_status) {
		this.profile_status = profile_status;
	}

	public boolean isIs_clinic_admin() {
		return is_clinic_admin;
	}

	public void setIs_clinic_admin(boolean is_clinic_admin) {
		this.is_clinic_admin = is_clinic_admin;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getProfile_view() {
		return profile_view;
	}

	public void setProfile_view(String profile_view) {
		this.profile_view = profile_view;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Profile getProfile() {
		return profile;
	}

	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	public String getCountry_code() {
		return country_code;
	}

	public void setCountry_code(String country_code) {
		this.country_code = country_code;
	}

	public String getCity_name_en() {
		return city_name_en;
	}

	public void setCity_name_en(String city_name_en) {
		this.city_name_en = city_name_en;
	}

	public int getPostalcode() {
		return postalcode;
	}

	public void setPostalcode(int postalcode) {
		this.postalcode = postalcode;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public boolean isValid_email() {
		return valid_email;
	}

	public void setValid_email(boolean valid_email) {
		this.valid_email = valid_email;
	}

	public void _toString() {
		System.out.println("Enter - _toString");
		super._toString();
		System.out.println("address: " + this.address + "\ncountry_code: "
				+ this.country_code + "\ncity_name_en: " + this.city_name_en
				+ "\ndescription: " + this.description + "\nemail address: "
				+ this.email_address + "\nfull name: " + this.full_name
				+ "\nhome phone: " + this.home_phone + "\nmobile phone: "
				+ this.mobile_phone + "\nmobile phone2: " + this.mobile_phone2
				+ "\nmrn: " + this.mrn + "\nprofile status: "
				+ this.profile_status + "\nprofile view: " + this.profile_view
				+ "\npt_obj_id: " + this.pt_obj_id + "\nfirst name: "
				+ this.first_name + "\nlast name: " + this.last_name + "\n"
				+ this.birthday + "\n" + this.gender + "\n" + this.is_baby
				+ "\n" + this.is_clinic_admin + "\nprofile ID: "
				+ this.profile.getPe_obj_id());
		System.out.println("Exit - _toString");
	}
}